<?php
$con = $con = mysqli_connect('localhost', 'root', '', 'chongqinghuoguo');
//连接数据库
mysqli_set_charset($con, 'utf8');
//设置编码格式
$sql = "select * from huoguo_xinwen";
//查询表
$result = mysqli_query($con, $sql);
//执行查询
$arr = mysqli_fetch_all($result, MYSQLI_ASSOC);
$json = json_decode($json);

echo $json;
mysqli_close($con);
//关闭数据链接
?>